{template 'common/header'}
<div class="main">
	{template 'nav'}

    <div class="panel panel-info">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
        	<input type="hidden" name="m" value="redpacksend_rp" />
        	<input type="hidden" name="do" value="prizelist" />
        	<input type="hidden" name="rid" value="{$_GPC['rid']}" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">兑奖密钥</label>
				<div class="col-sm-8 col-lg-9">
					<input class="form-control" name="keywords" id="" type="text" value="{$_GPC['keywords']}">
				</div>
			</div>
				<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
				<div class="col-sm-8 col-lg-9">
							<select name="status" class="form-control" style="float:left">
                                        <option value=""  {if $_GPC['status']==''}selected{/if}>全部</option>
                                        <option value="{php echo self::PACK_STATUS_DEFAULT}" {if $_GPC['status']==0   }selected{/if}>未激活</option>
                                        <option value="{php echo self::PACK_STATUS_ENABLE}" {if $_GPC['status']=='1'}selected{/if}>已激活</option>
                                        <option value="{php echo self::PACK_STATUS_SEND}" {if $_GPC['status']=='2'}selected{/if}>已发出</option>
                                        <option value="{php echo self::PACK_STATUS_ERROR}" {if $_GPC['status']=='2'}selected{/if}>出错</option>
							</select>
				</div>
                                <div class=" col-xs-12 col-sm-2 col-lg-2">

					<button type="submit" class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
				</div>
			</div>
			
 			<div class="form-group">
			</div>
		</form>
	</div>
	 
		<div style="padding: 0 15px 0  15px;">
		  <div class="row-fluid">
                                <div class="span8 control-group">
                                    <a class="btn btn-default" href="{php echo $this->createWebUrl('download',array('rid'=>$rid))}"><i class="icon-download-alt"></i>导出记录</a>

                                </div>
                            </div>

		</div>
	<div style="padding: 0 15px 0  15px;" style="position:relative">
		<table class="table table-hover" style="position:relative">
			<thead class="navbar-inner">
			 <tr>
                                                <th style='width:80px;'>序号</th>
                                                <th>密钥</th>
                                                <th>金额（元）</th>
                                                <th>用户</th>
                                                <th>发出时间</th>
                                                <th>状态</th>
                                                <th>操作</th>
		</tr>
			</thead>
			<tbody>
				{loop $list $row}
				<tr>
				<td>{$row['id']}</td>
                                 <td>{$row['password']}</td>
                                 <td>{php echo $row['money']/100}</td>
                                 <td>{if empty($row['openid'])}
                                    -----
                                    {else}
                                        {$row['openid']}
                                    {/if}
                                 </td>
                                 <td>{if $row['receiveTime']>0} {echo date('Y/m/d H:i',$row['receiveTime']);} {/if}</td>
                                 <td>{if $row['status']==0}
									 	<span class="label label-success">未激活</span>
									 {elseif $row['status']==1}
									 	<span class="label label-warning">可发出</span>
									 {elseif $row['status']==2}
									 <span class="label label-warning">已发出</span>
									 {else}
									 	<span class="label label-default">出错</span>
									 {/if}
                                </td>
                                 <td> </td>
				</tr>
				{/loop}

			</tbody>
		</table>
		{$pager}
	</div>
	
</div>

{template 'common/footer'}